# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=opensmtpd-table-mysql
pkgver=1.2
pkgrel=0
pkgdesc="OpenSMTPD MySQL tables"
url="https://github.com/OpenSMTPD/table-mysql"
arch="all"
license="ISC"
makedepends="
	autoconf
	automake
	mariadb-connector-c-dev
	"
subpackages="$pkgname-doc"
source="https://github.com/OpenSMTPD/table-mysql/archive/$pkgver/opensmtpd-table-mysql-$pkgver.tar.gz"
builddir="$srcdir/table-mysql-$pkgver"
options="!check"  # upstream does not provide tests

prepare() {
	default_prepare
	./bootstrap
}

build() {
	./configure \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--sysconfdir=/etc/smtpd
	make
}

package() {
	make DESTDIR="$pkgdir" smtpdir="/usr/lib/opensmtpd" install
}

sha512sums="
8fd32ada0d7da026eac89148bc186ac44274213cd60692ce2be7b3e7dc15d91c857ae5b7c2379dac1e0292f8efebba7504fad7aeb92375779e490207db97292f  opensmtpd-table-mysql-1.2.tar.gz
"
